﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudentMgmt.SQLServerDAL
{
    public class SQLClass
    {
        private string sql { get; set; }
        public SQLClass(string sql)
        {
            this.sql = sql;
            sonnstring = ConfigurationManager.ConnectionStrings["SQLProfileConnString"].ConnectionString;
            conn = new SqlConnection(sonnstring);
            cmd = new SqlCommand(sql, conn);
        }
        private static string sonnstring;
        private SqlConnection conn;
        private SqlCommand cmd;
        public int MyExecuteNonQuery()
        {
            conn.Open();
            int val = cmd.ExecuteNonQuery();
            conn.Close();
            return val;
        }
    }
}
